/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file Eth_Cfg.c
 * @brief AutoSAR ETH configuration source file
 * @details Automatically generated by user settings
 * @date 2025-03-25 19:03:22
 */

#ifdef __cplusplus
extern "C"{
#endif

#include "Eth.h"
#include "dwmac_common.h"

/* Version and Check Begin */
/* Version Info Begin */
#define ETH_CFG_C_VENDOR_ID    0x8C
#define ETH_CFG_C_MODULE_ID    88
#define ETH_CFG_C_AR_RELEASE_MAJOR_VERSION    4
#define ETH_CFG_C_AR_RELEASE_MINOR_VERSION    3
#define ETH_CFG_C_AR_RELEASE_REVISION_VERSION 1
#define ETH_CFG_C_SW_MAJOR_VERSION    1
#define ETH_CFG_C_SW_MINOR_VERSION    0
#define ETH_CFG_C_SW_PATCH_VERSION    0

/* Version Check Begin */
#if !defined(DISABLE_MCAL_ASR_VER_CHECK)
#if ((ETH_CFG_C_AR_RELEASE_MAJOR_VERSION != ETH_H_AR_RELEASE_MAJOR_VERSION)\
    || (ETH_CFG_C_AR_RELEASE_MINOR_VERSION != ETH_H_AR_RELEASE_MINOR_VERSION)\
    || (ETH_CFG_C_AR_RELEASE_REVISION_VERSION != ETH_H_AR_RELEASE_REVISION_VERSION))
    #error "Opps, Eth_PBCfg.c and Eth.h AutoSAR version not match!"
#endif
#endif  /* !DISABLE_MCAL_ASR_VER_CHECK */
#if !defined(DISABLE_MCAL_SW_VER_CHECK)
#if ((ETH_CFG_C_SW_MAJOR_VERSION != ETH_H_SW_MAJOR_VERSION)\
    || (ETH_CFG_C_SW_MINOR_VERSION != ETH_H_SW_MINOR_VERSION)\
    || (ETH_CFG_C_SW_PATCH_VERSION != ETH_H_SW_PATCH_VERSION))
    #error "Opps, Eth_PBCfg.c and Eth.h Software version not match!"
#endif
#endif  /* !DISABLE_MCAL_SW_VER_CHECK */
#if !defined(DISABLE_MCAL_ASR_VER_CHECK)
#if ((ETH_CFG_H_AR_RELEASE_MAJOR_VERSION != ETH_H_AR_RELEASE_MAJOR_VERSION)\
    || (ETH_CFG_H_AR_RELEASE_MINOR_VERSION != ETH_H_AR_RELEASE_MINOR_VERSION)\
    || (ETH_CFG_H_AR_RELEASE_REVISION_VERSION != ETH_H_AR_RELEASE_REVISION_VERSION))
    #error "Opps, Eth_PBCfg.h and Eth.h AutoSAR version not match!"
#endif
#endif  /* !DISABLE_MCAL_ASR_VER_CHECK */
#if !defined(DISABLE_MCAL_SW_VER_CHECK)
#if ((ETH_CFG_H_SW_MAJOR_VERSION != ETH_H_SW_MAJOR_VERSION)\
    || (ETH_CFG_H_SW_MINOR_VERSION != ETH_H_SW_MINOR_VERSION)\
    || (ETH_CFG_H_SW_PATCH_VERSION != ETH_H_SW_PATCH_VERSION))
    #error "Opps, Eth_PBCfg.h and Eth.h Software version not match!"
#endif
#endif  /* !DISABLE_MCAL_SW_VER_CHECK */

#if !defined(DISABLE_MCAL_ASR_VER_CHECK)
#if ((ETH_CFG_H_AR_RELEASE_MAJOR_VERSION != ETH_CFG_C_AR_RELEASE_MAJOR_VERSION)\
    || (ETH_CFG_H_AR_RELEASE_MINOR_VERSION != ETH_CFG_C_AR_RELEASE_MINOR_VERSION)\
    || (ETH_CFG_H_AR_RELEASE_REVISION_VERSION != ETH_CFG_C_AR_RELEASE_REVISION_VERSION))
    #error "Opps, Eth_PBCfg.h and Eth_PBCfg.c AutoSAR version not match!"
#endif
#endif  /* !DISABLE_MCAL_ASR_VER_CHECK */
#if !defined(DISABLE_MCAL_SW_VER_CHECK)
#if ((ETH_CFG_H_SW_MAJOR_VERSION != ETH_CFG_C_SW_MAJOR_VERSION)\
    || (ETH_CFG_H_SW_MINOR_VERSION != ETH_CFG_C_SW_MINOR_VERSION)\
    || (ETH_CFG_H_SW_PATCH_VERSION != ETH_CFG_C_SW_PATCH_VERSION))
    #error "Opps, Eth_PBCfg.h and Eth_PBCfg.c Software version not match!"
#endif
#endif  /* !DISABLE_MCAL_SW_VER_CHECK */
/* Version Check End */
/* Version and Check End */
/* Version and Check End */

#define ETH_START_SEC_CONST_UNSPECIFIED
#include "Eth_MemMap.h"

static CONST(Eth_EgressFifoType, ETH_CONST) Eth_EgressFifo_Config_0[2] = {
    {
        .FifoBufLenByte =128U,
        .FifoBufTotal =50U,
        .FifoIdx = 1U,
        .BufSize =  6400U,
    },
    {
        .FifoBufLenByte =1600U,
        .FifoBufTotal =2U,
        .FifoIdx = 0U,
        .BufSize =  3200U,
    },
};


static CONST(Eth_IngressFifoType, ETH_CONST) Eth_IngressFifo_Config_0[1] = {
    {
        .FifoBufLenByte =1600U,
        .FifoBufTotal =8U,
        .FifoIdx = 0U,
        .BufSize =  12800U,
    },
};

static CONST(Eth_EgressQueueCBSType, ETH_CONST) Eth_EgressQueueCbs_Config_0[ETH_MAX_DMA_CHANNEL] = {
    0
};



CONST(Eth_CntrlConfigType, ETH_CONST) EthControlConfig_Core0[1] = {
    {
        .MACAddrLow = 0x66554433U, /**< First 32 bits of MAC address */
        .MACAddrHigh = 0x00002210U,/**< last 32 bits of MAC address */
        .SocCtrlIdx = ETH1,
        .MacLayerSpeed = ETH_MAC_LAYER_SPEED_1G,
        .MacLayerType = ETH_MAC_LAYER_TYPE_XGMII,
        .MacLayerSubType = REDUCED,
        .Mtu = 1536U,
        .EnableRxInterrupt = (boolean)TRUE,
        .EnableTxInterrupt = (boolean)TRUE,
        .EnableRxcDelay = (boolean)FALSE,
        .EnableTxcDelay = (boolean)FALSE,
        .MiiSupport = (boolean)TRUE,
        .EthCtrlIdx = 0U,
        .EgressFifoNumber = sizeof(Eth_EgressFifo_Config_0)/sizeof(Eth_EgressFifoType),
        .IngressFifoNumber =  sizeof(Eth_IngressFifo_Config_0)/sizeof(Eth_IngressFifoType),
        .IngressFifoConfig = (Eth_IngressFifoType*)Eth_IngressFifo_Config_0,
        .EgressFifoConfig = (Eth_EgressFifoType*)Eth_EgressFifo_Config_0,
        .rxfilter = ALL_RX_PACKET,
        .ptp_mode = PTP_MASTER,
        .ptp_version = PTP_V2,
        .TxTrafficAlgorithms = MTL_TX_ALGORITHM_SP,
        .TrafficShaper = MTL_QUEUE_MODE_AVB,
        .MtlQueueMemPolicy = MTL_MEM_POLICY_DEFAULT,
        .CbsCfg = Eth_EgressQueueCbs_Config_0,
    },
};
CONST(Eth_CoreConfigType, ETH_CONST) EthCoreControlConfig_Core0 = {
    .EthCntrlConfigPtr = EthControlConfig_Core0,
    .EthMaxControllers = 1,
};

CONST(Eth_ConfigType, ETH_CONST) Eth_Control_Config = {
    .EthCoreConfig={
        &EthCoreControlConfig_Core0,
        NULL_PTR,
        NULL_PTR,
        NULL_PTR,
        NULL_PTR,
    }
};

#define ETH_STOP_SEC_CONST_UNSPECIFIED
#include "Eth_MemMap.h"

#ifdef __cplusplus
}
#endif
